import { createRouter, createWebHistory } from 'vue-router'
import About from '../views/About.vue'
import PageOne from '../views/PageOne.vue'
import PageTwo from '../views/PageTwo.vue'
import Book from '../views/Book.vue'
import App from '@/App.vue'
import Index from '../views/Index.vue'

const routes = [
  {
    path: '/',
    name: '首页',
    component: Index,
    redirect: '/about',
    children: [
      {
        path: 'about',
        name: '页面1',
        component: About
      }
    ]
  },
  {
    path: '/navigation',
    name: '个人中心',
    component: Index,
    children: [
      {
        path: 'pageOne',
        name: '页面2',
        component: PageOne
      },
      {
        path: 'pageTwo',
        name: '页面3',
        component: PageTwo
      },
      {
        path: 'book',
        name: '页面4',
        component: Book
      }
    ]
  },
  {
    path: '/r1',
    name: '管理员管理',
    component: Index
  },
  {
    path: '/r2',
    name: '基础数据管理',
    component: Index,
    children: [
      {
        path: 'c1',
        name: '仓库管理',
        component: About
      },
      {
        path: 'c2',
        name: '公告类型管理',
        component: About
      },
      {
        path: 'c3',
        name: '物资类型管理',
        component: About
      },
      {
        path: 'c4',
        name: '物资申请类型管理',
        component: About
      },
    ]
  },
  {
    path: '/r3',
    name: '公告管理',
    component: Index
  },
  {
    path: '/r4',
    name: '物资管理',
    component: Index
  },
  {
    path: '/r5',
    name: '用户管理',
    component: Index
  },
  {
    path: '/r6',
    name: '仓库管理员管理',
    component: Index
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
